<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

Route::get('/', function () {
    return view('welcome');
});

//普通路由
Route::get('/hello',function () {
	return "Hello World!生成url地址：".url("/aa");
});
//带参数路由
Route::get("/demo/{id}",function($id){
	return "参数id值".$id;
});
//带可选参数路由
Route::get("/demo2/{id?}",function($id=0){
	return "参数id值".$id;
});

//配置访问控制器的路由
Route::get('/hello2', "HelloController@aa");
Route::get('/demo1/add', "DemoController@add");

//RESTful路由的配置
Route::resource('stu', 'StuController');

//相册路由的配置
Route::resource('photo', 'PhotoController');

//文件上传路由的配置
Route::get('/upload',function () {
	return view('upload');
});
Route::post('/doupload', "DemoController@doUpload");

//响应测试路由配置
Route::get('/response', "DemoController@response");

//视图实例配置
Route::get('/view', "DemoController@view");